<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        img {
            width: 100px;
        }
    </style>
</head>
<body>
{#模板包含#}
{% include 'header.html' %}
<form method='get' action="/search/" target="_blank">
<input type="text" name="q">
<input type="submit" value="查询">
</form>
<table border="1">
    <thead>
    <tr>
        <td>id</td> <td>标题</td> <td>图片</td> <td>创建时间</td>
    </tr>
    </thead>
    <tbody>
    {% for item in page.object_list %}
        <tr>
            <td>{{ item.id }}</td>
            <td><a href="/newsm/detail/{{ item.id}}">{{ item.title }}</a></td>
            <td><img src="/media/{{ item.img }}"></td>
            <td>{{ item.createDate }}</td>
        </tr>
    {% endfor %}
    </tbody>
</table>
{% for index in page.paginator.page_range %}
    <a href="/newsm/news?currentPage={{ index }}">{{ index }}</a>
{% endfor %}
</body>
</html>